﻿function SelectAllCheckboxes(spanChk, rpt) {
    // Added as ASPX uses SPAN for checkbox
    var oItem = spanChk.children;
    var theBox = (spanChk.type == "checkbox") ? spanChk : spanChk.children.item[0];
    xState = theBox.checked;
    elm = theBox.form.elements;

    for (i = 0; i < elm.length; i++)
        if ((elm[i].type == "checkbox") && (elm[i].name.indexOf(rpt) > -1) && elm[i].id != theBox.id) {
            if (elm[i].checked != xState)
                elm[i].click();
        }
    }


//function setActiveMenu() {
//    //    var control = document.getElementById('tabid');
//    //    var menuid = control.innerText;
//    var sPath = window.location.pathname;
//    var tabID_1 = sPath.substring(sPath.lastIndexOf('/') + 1);
//    var tabID = tabID_1.substring(0, tabID_1.lastIndexOf('.'));
//    var menu = document.getElementById(tabID);
//    menu.className = 'current';
//}
//window.onload = setActiveMenu;
$(document).ready(function () {
    // Set focus on the correct tab in the menu.
    var tabID = "#" + $("#tabid").text();
    $(tabID).addClass("current");
});


function changeCheckBoxImg(x) {
    var strCheckName = new String("CheckBox" + x);
    // alert(strCheckName);
    var checkboxSelecting = document.getElementById(strCheckName);
    if (checkboxSelecting.checked) {
        checkboxSelecting.checked = false;
    } else checkboxSelecting.checked = true;
}



